package com.ruoyi.reward.mapper;

import java.util.List;
import com.ruoyi.reward.domain.CommunityReward;

/**
 * 积分商品Mapper接口
 * 
 * @author xianyu
 * @date 2025-04-04
 */
public interface CommunityRewardMapper 
{
    /**
     * 查询积分商品
     * 
     * @param id 积分商品主键
     * @return 积分商品
     */
    public CommunityReward selectCommunityRewardById(Long id);

    /**
     * 查询积分商品列表
     * 
     * @param communityReward 积分商品
     * @return 积分商品集合
     */
    public List<CommunityReward> selectCommunityRewardList(CommunityReward communityReward);

    public int  reduceStock (Long rewardId, int num);
    /**
     * 新增积分商品
     * 
     * @param communityReward 积分商品
     * @return 结果
     */
    public int insertCommunityReward(CommunityReward communityReward);

    /**
     * 修改积分商品状态
     * 
     * @param communityReward 积分商品
     * @return 结果
     */
    public int updateCommunityReward(CommunityReward communityReward);

    /**
     * 删除积分商品
     * 
     * @param id 积分商品主键
     * @return 结果
     */
    public int deleteCommunityRewardById(Long id);

    /**
     * 批量删除积分商品
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCommunityRewardByIds(Long[] ids);
}
